package com.lu.widgets.demo;

import com.lu.widgets.R;
import com.lu.widgets.component.ime.NumberIME;
import com.lu.widgets.component.ime.QwertyIME;
import com.lu.widgets.component.ime.QwertyNumberIME;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;

public class QwertyNumberIMETest extends Activity {
	/** Called when the activity is first created. */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.qwerty_number_ime_demo);

		QwertyNumberIME qwertyNumberIME = (QwertyNumberIME) findViewById(R.id.qwertyNumberIME);
		final EditText editText = (EditText) findViewById(R.id.editText);
		qwertyNumberIME.setTag(editText);
		qwertyNumberIME.setOnMaskClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				editText.setSelection(0, editText.getText().length());
			}
		});
		QwertyIME qwertyIME = (QwertyIME) findViewById(R.id.qwertyIME);
		EditText editTextQwerty = (EditText) findViewById(R.id.editTextQwerty);
		qwertyIME.setTag(editTextQwerty);
		editTextQwerty.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				((EditText) v).setSelection(0, ((EditText) v).getText()
						.length());
			}
		});
		NumberIME numberIME = (NumberIME) findViewById(R.id.numberIME);
		EditText editTextNumber = (EditText) findViewById(R.id.editTextNumber);
		numberIME.setTag(editTextNumber);
	}
}
